<!DOCTYPE html>
<html>
<head>
    <title>特种设备-叉车台账</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 100%;
            float: right;
        }
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
        .leftHeight{
            height: 85vh;
            overflow: auto;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
        .workShop{
            position: absolute;
            top: 0;
            width: 100%;
            height: 25px;
            background-color: white;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.devName" @on-enter="query" placeholder="请输入名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                <i-button type="info" @click="addEqu"><i class="fa fa-bars"></i>&nbsp;设备档案资料</i-button>
                #if($shiro.hasPermission("devfile:imports"))
                <Upload ref="uploadFile"
                        action="../specialdevforktruck/import"
                        :format ="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :show-upload-list="false"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="info"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>
                <i-button type="info" @click="exportData"><i class="fa fa-hand-o-up"></i>&nbsp;导出</i-button>
                #end
                #if($shiro.hasPermission("specialdevforktruck:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("specialdevforktruck:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("specialdevforktruck:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <!-- 使用单位树 -->
        <Row  :gutter="16" style="margin: 8px 0px 0px 1px;">
            <i-col :xs="3" :sm="3" :md="3" :lg="3">
                <div class="leftHeight" >
                    <div class="workShop">
                        <p class="text-center" style="font-size: 15px;">使用单位</p>
                    </div>
                    <div id="storeLayer" style="margin-top: 25px">
                        <ul id="storeTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="21" :sm="21" :md="21" :lg="21">
                <table  id="jqGrid"></table>
            </i-col>
        </Row>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="specialDevForkTruck" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="7">
                    <Form-item label="内部编号" prop="selfCode">
                        <i-input v-model="specialDevForkTruck.selfCode" placeholder="请输入内部编号"/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="设备名称" prop="devName">
                        <i-input v-model="specialDevForkTruck.devName" placeholder="请输入设备名称"/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="设备型号" prop="model">
                        <i-input v-model="specialDevForkTruck.model" placeholder="请输入设备型号"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="7">
                    <Form-item label="生产厂家" prop="factory">
                        <i-input v-model="specialDevForkTruck.factoryName" placeholder="请输入生产厂家" icon="md-arrow-dropdown-circle" @on-click="loadFacType" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="出厂编号" prop="productNo">
                        <i-input v-model="specialDevForkTruck.productNo" placeholder="请输入出厂编号"/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="叉车自重(KG)" prop="weight">
                        <i-input v-model="specialDevForkTruck.weight" placeholder="请输入叉车自重"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="7">
                    <Form-item label="资产编号" prop="fixedAssetCode">
                        <i-input v-model="specialDevForkTruck.fixedAssetCode" placeholder="请输入资产编号"/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="登记证代码" prop="registCertCode">
                        <i-input v-model="specialDevForkTruck.registCertCode" placeholder="请输入登记证代码"/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="设备代码" prop="devCode">
                        <i-input v-model="specialDevForkTruck.devCode" placeholder="请输入设备代码"/>
                    </Form-item>
                </i-col>

            </Row>
            <Row>
                <i-col span="7">
                    <Form-item label="使用单位" prop="userDeptName">
                        <i-input v-model="specialDevForkTruck.userDeptName" placeholder="请输入使用部门" icon="md-arrow-dropdown-circle"  readonly @on-click="showUserDeptList" />
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="使用地点" prop="location">
                        <i-input v-model="specialDevForkTruck.location" placeholder="请输入使用地点"/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="车辆牌照" prop="licensePlate">
                        <i-input v-model="specialDevForkTruck.licensePlate" placeholder="请输入车辆牌照"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="7">
                    <Form-item label="注册代码" prop="registCode">
                        <i-input v-model="specialDevForkTruck.registCode" placeholder="请输入注册代码"/>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="启用日期" prop="enableDate">
                        <Date-picker v-model="specialDevForkTruck.enableDate" placeholder="请输入启用日期"></Date-picker>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="使用状态" prop="state">
                        <i-input v-model="specialDevForkTruck.state" placeholder="请输入使用状态"/>
                    </Form-item>
                </i-col>

            </Row>
            <Row>
                <i-col span="7">
                    <Form-item label="最近一次检验日期" prop="latestInspectDate">
                        <Date-picker v-model="specialDevForkTruck.latestInspectDate" placeholder="最近检验日期"></Date-picker>
                    </Form-item>
                </i-col>
                <i-col span="7" offset="1">
                    <Form-item label="复检周期" prop="inspectInterval">
                        <i-select placeholder="复检周期" v-model="specialDevForkTruck.inspectIntervalStr">
                            <i-option value="12">一年</i-option>
                            <i-option value="24">两年</i-option>
                            <i-option value="36">三年</i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="23">
                    <Form-item label="备注" prop="remark">
                        <i-input type="textarea" v-model="specialDevForkTruck.remark" placeholder="备注"/>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>
<!-- 使用部门树，新增或修改时选择使用部门用 -->
<div id="categoryLayer" style="display: none;padding:10px;">
    <ul id="categoryTree" class="ztree"></ul>
</div>
<script src="${rc.contextPath}/js/device/specialdevforktruck.js?_${date.systemTime}"></script>
</body>
</html>
